Add Delete / Update modifiers for MySQL #1254#1396
Conversation
| startJoins=JoinsList() | ||
|
|
||
| <K_UPDATE> { update.setOracleHint(getOracleHint()); } | ||
| [(tk = <K_LOW_PRIORITY>) |
There was a problem hiding this comment.
Pardon me, I do not understand that line: would the token not always be "LOW_PRIORITY" and so modifierPriority = UpdateModifierPriority.LOW_PRIORITY?
Why would we not write this as
[ <K_LOW_PRIORITY> { modifierPriority = UpdateModifierPriority.LOW_PRIORITY; } ]
Am I missing something please?
There was a problem hiding this comment.
I fix that ok. I copy the logic from INSERT priority but they have more values...
There was a problem hiding this comment.
Apologies, I was not verbose enough. You can replace:
[(tk = <K_LOW_PRIORITY>)
{if (tk!=null)
modifierPriority = DeleteModifierPriority.LOW_PRIORITY;
}]
with a simple
[ <K_LOW_PRIORITY> { modifierPriority = UpdateModifierPriority.LOW_PRIORITY; } ]
Just showing the possibilities, you can leave as it is and let the compiler do the work.
There was a problem hiding this comment.
My fault sry ^^. Do I need something in this PR regarding your comment here ? #1382 (comment)
There was a problem hiding this comment.
Do I need something in this PR regarding your comment here ? #1382 (comment)
No, you did good.
I just used your contribution as an example, why we need to work on the Reserved Keyword Management in general and it is not certain, if @wumpz will like my idea. If he does, then your new token QUICK will be handled automatically. If he does not, we can add it any time later to the Allowed Keywords.
Managing Reserved Keywords in a JavaCC Grammar is a bit weird and not straight forward.
There was a problem hiding this comment.
Ok no problem, thanks for the review anyway.
|
Thank you so much for the contribution, good stuff!
|
Fixes Update ignore and delete ignore not parseable #1254
Add IGNORE parser/deparse for DELETE and UPDATE.
I find also two modifiers not available for MySQL so I also add LOW_PRIORITY modifier for DELETE and UPDATE, and QUICK modifier for DELETE.
Documentation : https://dev.mysql.com/doc/refman/8.0/en/update.html https://dev.mysql.com/doc/refman/8.0/en/delete.html
Example queries: